package com.cnoja.jmsncn.inf;

import com.cnoja.jmsncn.kernel.exceptions.CommandValidateException;

public interface ICommand {

	/**
	 * Returns the command string.
	 * 
	 * @return
	 */
	String getCommandString();

	/**
	 * If this command should receiving a response.
	 * 
	 * @return
	 */
	boolean hasResponse();

	/**
	 * If this command need validate.
	 * 
	 * @return
	 */
	boolean needValidate();

	/**
	 * Set if this command should receiving a response.
	 * 
	 * @param hasResponse
	 */
	void setHasResponse(boolean hasResponse);

	/**
	 * Set the command String.
	 * 
	 * @param commandString
	 */
	public void setCommandString(String commandString);

	/**
	 * Validate against the response.
	 * 
	 * @param commandString
	 * @throws CommandValidateException
	 */
	void validateResponse(IResponse response) throws CommandValidateException;

	@Override
	public int hashCode();

	Long getTransactionId();

	void setResponse(IResponse response);

	boolean hasNext();

	ICommand getNext();

	ICommand setNext(ICommand next);
	
	ICommander getCommander();
	void setCommander(ICommander commander);

}
